package edu.zjut.hjg.saas.web.controller.home;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import edu.zjut.hjg.saas.biz.model.City;
import edu.zjut.hjg.saas.biz.service.LocationService;

/**
 * 省市资源Ajax控制器
 * 
 * @author hjg
 */
@Controller
@RequestMapping("/location")
public class LocationController {

    @Autowired
    private LocationService locationService;

    @RequestMapping("/listCities.htm")
    @ResponseBody
    public List<City> listCities(@RequestParam("provinceCode") String provinceCode) {
        return locationService.listCitesByProvinceCode(provinceCode);
    }
}
